﻿using System;
using System.Collections.Generic;
using System.IO;
using KKSG;
using MiniJSON;
using UnityEngine;
using XMainClient.UI;
using XMainClient.UI.UICommon;
using XUpdater;
using XUtliPoolLib;

namespace XMainClient
{
	// Token: 0x020009F1 RID: 2545
	internal class XOptionsDocument : XDocComponent
	{
		// Token: 0x17002E58 RID: 11864
		// (get) Token: 0x06009BD1 RID: 39889 RVA: 0x0018F1E0 File Offset: 0x0018D3E0
		public override uint ID
		{
			get
			{
				return XOptionsDocument.uuID;
			}
		}

		// Token: 0x17002E59 RID: 11865
		// (get) Token: 0x06009BD2 RID: 39890 RVA: 0x0018F1F8 File Offset: 0x0018D3F8
		// (set) Token: 0x06009BD3 RID: 39891 RVA: 0x0018F210 File Offset: 0x0018D410
		public XOptionsView View
		{
			get
			{
				return this._view;
			}
			set
			{
				this._view = value;
			}
		}

		// Token: 0x06009BD4 RID: 39892 RVA: 0x0018F21A File Offset: 0x0018D41A
		public override void OnAttachToHost(XObject host)
		{
			base.OnAttachToHost(host);
			this.LoadSetting();
			this.RefreshLocalSettings();
			XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local_clear", "");
		}

		// Token: 0x06009BD5 RID: 39893 RVA: 0x0018F250 File Offset: 0x0018D450
		public static void Execute(OnLoadedCallback callback = null)
		{
			XOptionsDocument.AsyncLoader.AddTask("Table/PushSetting", XOptionsDocument._pushSettingTable, false);
			XOptionsDocument.AsyncLoader.AddTask("Table/PushMessage", XOptionsDocument._pushMessageTable, false);
			XOptionsDocument.AsyncLoader.AddTask("Table/XOptions", XOptionsDocument._optionsTable, false);
			XOptionsDocument.AsyncLoader.Execute(callback);
		}

		// Token: 0x06009BD6 RID: 39894 RVA: 0x0018F2AC File Offset: 0x0018D4AC
		public static void OnTableLoaded()
		{
			XOptionsDocument.pushSettings.Clear();
			for (int i = 0; i < XOptionsDocument._pushSettingTable.Table.Length; i++)
			{
				bool flag = XOptionsDocument._pushSettingTable.Table[i].TimeOrSystem == 1U;
				if (flag)
				{
					XOptionsDocument._pushSetting1.Add(XOptionsDocument._pushSettingTable.Table[i]);
				}
				else
				{
					bool flag2 = XOptionsDocument._pushSettingTable.Table[i].TimeOrSystem == 2U;
					if (flag2)
					{
						XOptionsDocument._pushSetting2.Add(XOptionsDocument._pushSettingTable.Table[i]);
					}
				}
				string configKey = XOptionsDocument._pushSettingTable.Table[i].ConfigKey;
				XOptionsDocument.pushSettings.Add(configKey, 1);
			}
			XOptionsDocument.optionsData.Clear();
			for (int j = 0; j < XFastEnumIntEqualityComparer<OptionsBattleTab>.ToInt(OptionsBattleTab.OtherTab); j++)
			{
				XOptionsDocument.optionsData.Add(new List<List<XOptions.RowData>>());
				XOptionsDefine option = XOptionsDefine.OD_VIEW + j;
				XOptions.RowData optionData = XOptionsDocument.GetOptionData(option);
				bool flag3 = optionData.OptionText != null;
				if (flag3)
				{
					for (int k = 0; k < optionData.OptionText.Length; k++)
					{
						XOptionsDocument.optionsData[j].Add(new List<XOptions.RowData>());
					}
				}
				else
				{
					XOptionsDocument.optionsData[j].Add(new List<XOptions.RowData>());
				}
			}
			for (int l = 0; l < XOptionsDocument._optionsTable.Table.Length; l++)
			{
				int id = XOptionsDocument._optionsTable.Table[l].ID;
				int num = XOptionsDocument._optionsTable.Table[l].Classify[0];
				int num2 = XOptionsDocument._optionsTable.Table[l].Classify[1];
				int type = XOptionsDocument._optionsTable.Table[l].Type;
				int sort = XOptionsDocument._optionsTable.Table[l].Sort;
				bool flag4 = id <= 0;
				if (!flag4)
				{
					XOptions.RowData rowData = XOptionsDocument._optionsTable.Table[l];
					bool flag5 = rowData.ID != 0;
					if (flag5)
					{
						XOptionsDocument.optionDefault.Init();
						string[] array = rowData.Default.Split(new char[]
						{
							'|'
						});
						XOptionsDocument.optionDefault.NeedSight = (array.Length != 1);
						for (int m = 0; m < XOptionsDocument.SIGHT_NUM; m++)
						{
							bool flag6 = array.Length == 1;
							string text;
							if (flag6)
							{
								text = array[0];
							}
							else
							{
								text = array[m];
							}
							string[] array2 = text.Split(new char[]
							{
								'='
							});
							XOptionsDocument.optionDefault.NeedProfession[m] = (array2.Length != 1);
							for (int n = 0; n < XGame.RoleCount; n++)
							{
								bool flag7 = array2.Length == 1;
								string text2;
								if (flag7)
								{
									text2 = array2[0];
								}
								else
								{
									text2 = array2[n];
								}
								XOptionsDocument.optionDefault.val[m, n] = text2;
							}
						}
						XOptionsDocument.optionsDefault.Add((XOptionsDefine)rowData.ID, XOptionsDocument.optionDefault);
					}
					bool flag8 = (num == 0 && num2 == 0) || type == 0;
					if (!flag8)
					{
						bool flag9 = XOptionsDocument.optionsData.Count >= num && XOptionsDocument.optionsData[num - 1].Count >= num2;
						if (flag9)
						{
							XOptionsDocument.optionsData[num - 1][num2 - 1].Add(rowData);
						}
						else
						{
							XSingleton<XDebug>.singleton.AddErrorLog("XOptions Table Error! ID:" + rowData.ID, null, null, null, null, null);
						}
					}
				}
			}
			for (int num3 = 0; num3 < XOptionsDocument.optionsData.Count; num3++)
			{
				for (int num4 = 0; num4 < XOptionsDocument.optionsData[num3].Count; num4++)
				{
					XOptionsDocument.optionsData[num3][num4].Sort(new Comparison<XOptions.RowData>(XOptionsDocument.SortCompare));
				}
			}
		}

		// Token: 0x06009BD7 RID: 39895 RVA: 0x0018F6EC File Offset: 0x0018D8EC
		public static XOptions.RowData GetOptionData(XOptionsDefine option)
		{
			return XOptionsDocument.GetOptionData(XFastEnumIntEqualityComparer<XOptionsDefine>.ToInt(option));
		}

		// Token: 0x06009BD8 RID: 39896 RVA: 0x0018F70C File Offset: 0x0018D90C
		public static XOptions.RowData GetOptionData(int optionID)
		{
			return XOptionsDocument._optionsTable.GetByID(optionID);
		}

		// Token: 0x06009BD9 RID: 39897 RVA: 0x0018F72C File Offset: 0x0018D92C
		private static int SortCompare(XOptions.RowData item1, XOptions.RowData item2)
		{
			int sort = item1.Sort;
			int sort2 = item2.Sort;
			bool flag = sort == sort2;
			int result;
			if (flag)
			{
				result = -item1.ID.CompareTo(item2.ID);
			}
			else
			{
				result = -sort.CompareTo(sort2);
			}
			return result;
		}

		// Token: 0x06009BDA RID: 39898 RVA: 0x0018F774 File Offset: 0x0018D974
		public override void OnEnterSceneFinally()
		{
			SceneTable.RowData sceneData = XSingleton<XSceneMgr>.singleton.GetSceneData(XSingleton<XScene>.singleton.SceneID);
			bool flag = sceneData != null && sceneData.ShieldSight != null;
			if (flag)
			{
				for (int i = 0; i < sceneData.ShieldSight.Length; i++)
				{
					bool flag2 = (int)sceneData.ShieldSight[i] == this.GetValue(XOptionsDefine.OD_VIEW);
					if (flag2)
					{
						this.SetDefaultSight(sceneData.ShieldSight);
						break;
					}
				}
			}
			this.SetBattleOptionValue();
			bool flag3 = DlgBase<BattleMain, BattleMainBehaviour>.singleton.IsVisible();
			if (flag3)
			{
				DlgBase<BattleMain, BattleMainBehaviour>.singleton.SetView(XSingleton<XOperationData>.singleton.OperationMode);
			}
			bool flag4 = XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_HORSE_RACE || XSingleton<XScene>.singleton.SceneType == SceneType.SCENE_WEEKEND4V4_HORSERACING;
			if (flag4)
			{
			}
		}

		// Token: 0x06009BDB RID: 39899 RVA: 0x0018F848 File Offset: 0x0018DA48
		private void SetDefaultSight(byte[] shieldSight)
		{
			for (XOperationMode xoperationMode = XOperationMode.X25D; xoperationMode <= XOperationMode.X3D_Free; xoperationMode++)
			{
				bool flag = true;
				for (int i = 0; i < shieldSight.Length; i++)
				{
					bool flag2 = (XOperationMode)shieldSight[i] == xoperationMode;
					if (flag2)
					{
						flag = false;
						break;
					}
				}
				bool flag3 = flag;
				if (flag3)
				{
					this.SetValue(XOptionsDefine.OD_VIEW, XFastEnumIntEqualityComparer<XOperationMode>.ToInt(xoperationMode), false);
					XSingleton<XDebug>.singleton.AddGreenLog("Auto Change Sight:" + xoperationMode.ToString(), null, null, null, null, null);
					return;
				}
			}
			XSingleton<XDebug>.singleton.AddErrorLog("No Default Sight", null, null, null, null, null);
		}

		// Token: 0x06009BDC RID: 39900 RVA: 0x0018F8F0 File Offset: 0x0018DAF0
		public override void OnGamePause(bool pause)
		{
			XSingleton<XDebug>.singleton.AddLog("push_local_clear", null, null, null, null, null, XDebugColor.XDebug_None);
			XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local_clear", "");
			if (pause)
			{
				DateTime now = DateTime.Now;
				int hour = now.Hour;
				int minute = now.Minute;
				int num = Convert.ToInt32(DateTime.Now.DayOfWeek.ToString("d"));
				for (int i = 0; i < XOptionsDocument._pushMessageTable.Table.Length; i++)
				{
					PushMessageTable.RowData rowData = XOptionsDocument._pushMessageTable.Table[i];
					bool flag = rowData.IsCommonGlobal == 1U && this.IsPushOpen(rowData.Type);
					if (flag)
					{
						bool flag2 = rowData.WeekDay == null || rowData.WeekDay.Length == 0;
						if (flag2)
						{
							bool flag3 = (ulong)rowData.Time[0] > (ulong)((long)hour) || ((ulong)rowData.Time[0] == (ulong)((long)hour) && (ulong)rowData.Time[1] > (ulong)((long)minute));
							if (flag3)
							{
								XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local", this.MakeJson(rowData, now));
							}
							DateTime date = now.AddDays(1.0);
							XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local", this.MakeJson(rowData, date));
							DateTime date2 = now.AddDays(2.0);
							XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local", this.MakeJson(rowData, date2));
						}
						else
						{
							for (int j = 0; j < rowData.WeekDay.Length; j++)
							{
								bool flag4 = rowData.WeekDay[j] == (uint)num;
								if (flag4)
								{
									bool flag5 = (ulong)rowData.Time[0] > (ulong)((long)hour) || ((ulong)rowData.Time[0] == (ulong)((long)hour) && (ulong)rowData.Time[1] > (ulong)((long)minute));
									if (flag5)
									{
										XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local", this.MakeJson(rowData, now));
									}
								}
								else
								{
									bool flag6 = rowData.WeekDay[j] > (uint)num;
									if (flag6)
									{
										DateTime date3 = now.AddDays((double)((ulong)rowData.WeekDay[j] - (ulong)((long)num)));
										XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendGameExData("push_local", this.MakeJson(rowData, date3));
									}
								}
							}
						}
					}
				}
			}
			base.OnGamePause(pause);
		}

		// Token: 0x06009BDD RID: 39901 RVA: 0x0018FB9C File Offset: 0x0018DD9C
		private string MakeJson(PushMessageTable.RowData row, DateTime date)
		{
			Dictionary<string, object> dictionary = new Dictionary<string, object>();
			dictionary["title"] = row.Title;
			dictionary["content"] = row.Content;
			dictionary["type"] = 1;
			bool flag = Application.platform == (RuntimePlatform)8;
			if (flag)
			{
				dictionary["date"] = date.ToString("yyyy-MM-dd");
				dictionary["hour"] = ((row.Time[0] < 10U) ? ("0" + row.Time[0].ToString()) : row.Time[0].ToString());
				dictionary["min"] = ((row.Time[1] < 10U) ? ("0" + row.Time[1].ToString()) : row.Time[1].ToString());
			}
			else
			{
				dictionary["date"] = date.ToString("yyyyMMdd");
				dictionary["hour"] = row.Time[0];
				dictionary["min"] = row.Time[1];
			}
			string text = Json.Serialize(dictionary);
			XSingleton<XDebug>.singleton.AddLog(Application.platform.ToString(), " => ", text, null, null, null, XDebugColor.XDebug_None);
			return text;
		}

		// Token: 0x06009BDE RID: 39902 RVA: 0x0018FD20 File Offset: 0x0018DF20
		private bool IsPushOpen(uint type)
		{
			for (int i = 0; i < XOptionsDocument._pushSettingTable.Table.Length; i++)
			{
				bool flag = XOptionsDocument._pushSettingTable.Table[i].Type == type;
				if (flag)
				{
					return XOptionsDocument.pushSettings[XOptionsDocument._pushSettingTable.Table[i].ConfigKey] == 1;
				}
			}
			return true;
		}

		// Token: 0x06009BDF RID: 39903 RVA: 0x0018FD8A File Offset: 0x0018DF8A
		public void OnBlockOtherPlayers()
		{
			this.ProccessOption(XOptionsDefine.OD_BLOCKOTHERPLAYERS, this.GetValue(XOptionsDefine.OD_BLOCKOTHERPLAYERS));
		}

		// Token: 0x06009BE0 RID: 39904 RVA: 0x0018FD9E File Offset: 0x0018DF9E
		protected override void EventSubscribe()
		{
			base.EventSubscribe();
			base.RegisterEvent(XEventDefine.XEvent_AudioOperation, new XComponent.XEventHandler(this.OnChatVoiceHandled));
		}

		// Token: 0x06009BE1 RID: 39905 RVA: 0x0018FDC0 File Offset: 0x0018DFC0
		public void InitServerConfig(RoleConfig serverConfig)
		{
			bool flag = serverConfig != null;
			if (flag)
			{
				bool flag2 = serverConfig.type.Count != serverConfig.value.Count;
				if (flag2)
				{
					XSingleton<XDebug>.singleton.AddErrorLog("serverConfig.type.Count != serverConfig.value.Count", null, null, null, null, null);
				}
				else
				{
					Type typeFromHandle = typeof(XOptionsDefine);
					for (int i = 0; i < serverConfig.type.Count; i++)
					{
						try
						{
							bool flag3 = XOptionsDocument.pushSettings.ContainsKey(serverConfig.type[i]);
							if (flag3)
							{
								bool flag4 = !XOptionsDocument.localPushSetting.ContainsKey(serverConfig.type[i]);
								if (flag4)
								{
									XOptionsDocument.pushSettings[serverConfig.type[i]] = int.Parse(serverConfig.value[i]);
								}
							}
							else
							{
								XOptionsDefine xoptionsDefine = (XOptionsDefine)Enum.Parse(typeFromHandle, serverConfig.type[i]);
								XOptionsDefine xoptionsDefine2 = xoptionsDefine;
								if (xoptionsDefine2 != XOptionsDefine.OD_TEAM_PASSWORD)
								{
									XOptions.RowData optionData = XOptionsDocument.GetOptionData(xoptionsDefine);
									bool flag5 = optionData != null && optionData.Type != 0;
									if (flag5)
									{
										bool flag6 = optionData.Type == 2;
										if (flag6)
										{
											float value;
											bool flag7 = float.TryParse(serverConfig.value[i], out value);
											if (flag7)
											{
												this.floatOptions[xoptionsDefine] = value;
											}
											this.ProccessOption(xoptionsDefine, this.GetFloatValue(xoptionsDefine));
										}
										else
										{
											int value2;
											bool flag8 = int.TryParse(serverConfig.value[i], out value2);
											if (flag8)
											{
												this.options[xoptionsDefine] = value2;
											}
											this.ProccessOption(xoptionsDefine, this.GetValue(xoptionsDefine));
										}
									}
								}
								else
								{
									this.strOptions.Add(xoptionsDefine, serverConfig.value[i]);
								}
							}
						}
						catch (ArgumentException)
						{
							XSingleton<XDebug>.singleton.AddGreenLog(string.Format("'{0}' is not a member of the XOptionsDefine enumeration.", serverConfig.type[i]), null, null, null, null, null);
						}
					}
				}
			}
		}

		// Token: 0x06009BE2 RID: 39906 RVA: 0x0018FFFC File Offset: 0x0018E1FC
		public void RefreshLocalSettings()
		{
			for (XOptionsDefine xoptionsDefine = XOptionsDefine.OD_START; xoptionsDefine != XOptionsDefine.OD_LOCALSETTING_END; xoptionsDefine++)
			{
				this.ProccessOption(xoptionsDefine, this.GetValue(xoptionsDefine));
			}
		}

		// Token: 0x06009BE3 RID: 39907 RVA: 0x00190034 File Offset: 0x0018E234
		public void LoadSetting()
		{
			string path = Application.persistentDataPath + "/options.txt";
			bool flag = Application.platform == (RuntimePlatform)7 || Application.platform == (RuntimePlatform)0 || Application.platform == (RuntimePlatform)2;
			if (flag)
			{
				path = Application.dataPath + "/options.txt";
			}
			this.options.Clear();
			bool flag2 = !File.Exists(path);
			if (!flag2)
			{
				using (StreamReader streamReader = new StreamReader(path))
				{
					Type typeFromHandle = typeof(XOptionsDefine);
					string text;
					while ((text = streamReader.ReadLine()) != null)
					{
						string[] array = text.Split(XGlobalConfig.SpaceSeparator);
						bool flag3 = array.Length != 2;
						if (flag3)
						{
							XSingleton<XDebug>.singleton.AddErrorLog("Option file format error: ", text, null, null, null, null);
						}
						else
						{
							try
							{
								bool flag4 = XOptionsDocument.pushSettings.ContainsKey(array[0]);
								if (flag4)
								{
									int value = int.Parse(array[1]);
									XOptionsDocument.pushSettings[array[0]] = value;
									XOptionsDocument.localPushSetting[array[0]] = value;
								}
								else
								{
									XOptionsDefine key = (XOptionsDefine)Enum.Parse(typeFromHandle, array[0]);
									this.options.Add(key, int.Parse(array[1]));
								}
							}
							catch (ArgumentException)
							{
								XSingleton<XDebug>.singleton.AddErrorLog(string.Format("'{0}' is not a member of the XOptionsDefine enumeration.", array[0]), null, null, null, null, null);
							}
						}
					}
				}
			}
		}

		// Token: 0x06009BE4 RID: 39908 RVA: 0x001901CC File Offset: 0x0018E3CC
		public void SaveSetting()
		{
			try
			{
				string text = Application.persistentDataPath + "/options.txt";
				bool flag = Application.platform == (RuntimePlatform)7 || Application.platform == (RuntimePlatform)0 || Application.platform == (RuntimePlatform)2;
				if (flag)
				{
					text = Application.dataPath + "/options.txt";
				}
				using (StreamWriter streamWriter = new StreamWriter(text))
				{
					foreach (KeyValuePair<string, int> keyValuePair in XOptionsDocument.localPushSetting)
					{
						streamWriter.Write(keyValuePair.Key);
						streamWriter.Write(' ');
						streamWriter.WriteLine(keyValuePair.Value);
					}
					foreach (KeyValuePair<XOptionsDefine, int> keyValuePair2 in this.options)
					{
						bool flag2 = keyValuePair2.Key >= XOptionsDefine.OD_LOCALSETTING_END;
						if (!flag2)
						{
							streamWriter.Write(keyValuePair2.Key);
							streamWriter.Write(' ');
							streamWriter.WriteLine(keyValuePair2.Value);
						}
					}
					foreach (KeyValuePair<XOptionsDefine, float> keyValuePair3 in this.floatOptions)
					{
						bool flag3 = keyValuePair3.Key >= XOptionsDefine.OD_LOCALSETTING_END;
						if (!flag3)
						{
							streamWriter.Write(keyValuePair3.Key);
							streamWriter.Write(' ');
							streamWriter.WriteLine(keyValuePair3.Value);
						}
					}
					XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SetNoBackupFlag(text);
				}
			}
			catch (Exception)
			{
				XSingleton<XDebug>.singleton.AddErrorLog("Save Setting Error", null, null, null, null, null);
			}
		}

		// Token: 0x06009BE5 RID: 39909 RVA: 0x00190424 File Offset: 0x0018E624
		public void ReqSwitchAccount()
		{
			XSingleton<XClientNetwork>.singleton.Close(NetErrCode.Net_NoError);
			XSingleton<XLoginDocument>.singleton.AuthorizationSignOut();
		}

		// Token: 0x06009BE6 RID: 39910 RVA: 0x00190440 File Offset: 0x0018E640
		public void ReqSwitchChar()
		{
			RpcC2M_ReturnToSelectRole rpc = new RpcC2M_ReturnToSelectRole();
			XSingleton<XClientNetwork>.singleton.Send(rpc);
		}

		// Token: 0x06009BE7 RID: 39911 RVA: 0x00190460 File Offset: 0x0018E660
		public void ReqCustomerService()
		{
			XSingleton<XDebug>.singleton.AddLog("CS coming soon!", null, null, null, null, null, XDebugColor.XDebug_None);
		}

		// Token: 0x06009BE8 RID: 39912 RVA: 0x0019047C File Offset: 0x0018E67C
		public void OpenCustomerService()
		{
			Dictionary<string, string> dictionary = new Dictionary<string, string>();
			RuntimePlatform platform = Application.platform;
			if (platform != (RuntimePlatform)8)
			{
				if (platform != (RuntimePlatform)11)
				{
					XSingleton<XDebug>.singleton.AddGreenLog("CustomerService-Options", null, null, null, null, null);
				}
				else
				{
					dictionary["url"] = XSingleton<XGlobalConfig>.singleton.GetValue("CustomerServiceSetAndroid");
					dictionary["screendir"] = "SENSOR";
					XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
				}
			}
			else
			{
				dictionary["url"] = XSingleton<XGlobalConfig>.singleton.GetValue("CustomerServiceSetApple");
				dictionary["screendir"] = "SENSOR";
				XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SendExtDara("open_url", Json.Serialize(dictionary));
			}
		}

		// Token: 0x06009BE9 RID: 39913 RVA: 0x0019054F File Offset: 0x0018E74F
		public void OpenURL(string url)
		{
			Application.OpenURL(url);
		}

		// Token: 0x06009BEA RID: 39914 RVA: 0x0019055C File Offset: 0x0018E75C
		public override void Update(float fDeltaT)
		{
			base.Update(fDeltaT);
			bool flag = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible() && this.View.CurrentTab == OptionsTab.OptionTab && (double)Math.Abs(this.lastSameScreenValue - this.View.uiBehaviour.m_SameScreenBar.value) > 1E-05;
			if (flag)
			{
				this.lastSameScreenValue = this.View.uiBehaviour.m_SameScreenBar.value;
				this.View.SameScreenNumChange(this.lastSameScreenValue);
			}
			bool flag2 = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible() && this.View.CurrentTab == OptionsTab.OptionTab && (double)Math.Abs(this.lastSound - this.View.uiBehaviour.m_SoundBar.value) > 1E-05;
			if (flag2)
			{
				this.lastSound = this.View.uiBehaviour.m_SoundBar.value;
				this.SetValue(XOptionsDefine.BA_SOUND, (int)(this.lastSound * 100f), false);
				this.ProccessOption(XOptionsDefine.BA_SOUND, (int)(this.lastSound * 100f));
			}
			bool flag3 = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible() && this.View.CurrentTab == OptionsTab.OptionTab && (double)Math.Abs(this.lastMusic - this.View.uiBehaviour.m_MusicBar.value) > 1E-05;
			if (flag3)
			{
				this.lastMusic = this.View.uiBehaviour.m_MusicBar.value;
				this.SetValue(XOptionsDefine.BA_MUSIC, (int)(this.lastMusic * 100f), false);
				this.ProccessOption(XOptionsDefine.BA_MUSIC, (int)(this.lastMusic * 100f));
			}
			bool flag4 = DlgBase<XOptionsView, XOptionsBehaviour>.singleton.IsVisible() && this.View.CurrentTab == OptionsTab.OptionTab && (double)Math.Abs(this.lastVoice - this.View.uiBehaviour.m_VoiceBar.value) > 1E-05;
			if (flag4)
			{
				this.lastVoice = this.View.uiBehaviour.m_VoiceBar.value;
				this.SetValue(XOptionsDefine.BA_VOICE, (int)(this.lastVoice * 100f), false);
				this.ProccessOption(XOptionsDefine.BA_VOICE, (int)(this.lastVoice * 100f));
			}
		}

		// Token: 0x06009BEB RID: 39915 RVA: 0x001907B4 File Offset: 0x0018E9B4
		private PushSetting.RowData GetPushSettingRow(string option)
		{
			for (int i = 0; i < XOptionsDocument._pushSettingTable.Table.Length; i++)
			{
				bool flag = XOptionsDocument._pushSettingTable.Table[i].ConfigKey == option;
				if (flag)
				{
					return XOptionsDocument._pushSettingTable.Table[i];
				}
			}
			return null;
		}

		// Token: 0x06009BEC RID: 39916 RVA: 0x00190810 File Offset: 0x0018EA10
		public void SavePushValue(string option, int value)
		{
			bool flag = XOptionsDocument.pushSettings.ContainsKey(option);
			if (flag)
			{
				XOptionsDocument.pushSettings[option] = value;
				bool flag2 = this.GetPushSettingRow(option).TimeOrSystem == 1U;
				if (flag2)
				{
					XOptionsDocument.localPushSetting[option] = value;
				}
				else
				{
					RpcC2G_SetRoleConfig rpcC2G_SetRoleConfig = new RpcC2G_SetRoleConfig();
					rpcC2G_SetRoleConfig.oArg.type = option;
					rpcC2G_SetRoleConfig.oArg.value = value.ToString();
					XSingleton<XClientNetwork>.singleton.Send(rpcC2G_SetRoleConfig);
				}
			}
			else
			{
				XSingleton<XDebug>.singleton.AddErrorLog("not push type ", option, null, null, null, null);
			}
		}

		// Token: 0x06009BED RID: 39917 RVA: 0x001908AD File Offset: 0x0018EAAD
		private void SaveToCloud(XOptionsDefine option, int value)
		{
			this.SaveToCloud(option, value.ToString());
		}

		// Token: 0x06009BEE RID: 39918 RVA: 0x001908C0 File Offset: 0x0018EAC0
		private void SaveToCloud(XOptionsDefine option, string value)
		{
			bool flag = option > XOptionsDefine.OD_LOCALSETTING_END;
			if (flag)
			{
				RpcC2G_SetRoleConfig rpcC2G_SetRoleConfig = new RpcC2G_SetRoleConfig();
				rpcC2G_SetRoleConfig.oArg.type = option.ToString();
				rpcC2G_SetRoleConfig.oArg.value = value;
				XSingleton<XClientNetwork>.singleton.Send(rpcC2G_SetRoleConfig);
			}
		}

		// Token: 0x06009BEF RID: 39919 RVA: 0x00190914 File Offset: 0x0018EB14
		public bool SetValue(XOptionsDefine option, int value, bool isMustSave = false)
		{
			bool flag = !isMustSave && this.GetValue(option) == value;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				this.options[option] = value;
				this.ProccessOption(option, value);
				this.SaveToCloud(option, value);
				result = true;
			}
			return result;
		}

		// Token: 0x06009BF0 RID: 39920 RVA: 0x00190960 File Offset: 0x0018EB60
		public bool SetSliderValue(XOptionsDefine option, float value)
		{
			bool flag = this.GetFloatValue(option) == value;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				this.floatOptions[option] = value;
				this.ProccessOption(option, value);
				this.SaveToCloud(option, value.ToString());
				result = true;
			}
			return result;
		}

		// Token: 0x06009BF1 RID: 39921 RVA: 0x001909AC File Offset: 0x0018EBAC
		public bool SetValue(XOptionsDefine option, string value)
		{
			bool flag = this.GetStrValue(option) == value;
			bool result;
			if (flag)
			{
				result = false;
			}
			else
			{
				this.strOptions[option] = value;
				this.SaveToCloud(option, value);
				result = true;
			}
			return result;
		}

		// Token: 0x06009BF2 RID: 39922 RVA: 0x001909EC File Offset: 0x0018EBEC
		public int GetPushValue(string option)
		{
			bool flag = XOptionsDocument.pushSettings.ContainsKey(option);
			int result;
			if (flag)
			{
				result = XOptionsDocument.pushSettings[option];
			}
			else
			{
				result = 0;
			}
			return result;
		}

		// Token: 0x06009BF3 RID: 39923 RVA: 0x00190A20 File Offset: 0x0018EC20
		public int GetValue(XOptionsDefine option)
		{
			int num;
			bool flag = this.options.TryGetValue(option, out num);
			int result;
			if (flag)
			{
				result = num;
			}
			else
			{
				result = this.GetDefaultValue(option);
			}
			return result;
		}

		// Token: 0x06009BF4 RID: 39924 RVA: 0x00190A54 File Offset: 0x0018EC54
		public float GetFloatValue(XOptionsDefine option)
		{
			float num;
			bool flag = this.floatOptions.TryGetValue(option, out num);
			float result;
			if (flag)
			{
				result = num;
			}
			else
			{
				result = this.GetDefaultFloatValue(option);
			}
			return result;
		}

		// Token: 0x06009BF5 RID: 39925 RVA: 0x00190A88 File Offset: 0x0018EC88
		public string GetStrValue(XOptionsDefine option)
		{
			string text;
			bool flag = this.strOptions.TryGetValue(option, out text);
			string result;
			if (flag)
			{
				result = text;
			}
			else
			{
				result = this.GetDefaultStrValue(option);
			}
			return result;
		}

		// Token: 0x06009BF6 RID: 39926 RVA: 0x00190ABC File Offset: 0x0018ECBC
		private void ProccessOption(XOptionsDefine option, int value)
		{
			switch (option)
			{
			case XOptionsDefine.OD_SOUND:
				this.openSound = (value == 1);
				this.SetBGMVolme(this.openSound ? ((this.lastSound == -1f) ? 1f : this.lastSound) : 0f);
				break;
			case XOptionsDefine.BA_SOUND:
			{
				bool flag = this.openSound;
				if (flag)
				{
					this.SetBGMVolme((float)value / 100f);
				}
				break;
			}
			case XOptionsDefine.OD_MUSIC:
				this.openMusic = (value == 1);
				this.SetMuscVolme(this.openMusic ? ((this.lastMusic == -1f) ? 1f : this.lastMusic) : 0f);
				break;
			case XOptionsDefine.BA_MUSIC:
			{
				bool flag2 = this.openMusic;
				if (flag2)
				{
					this.SetMuscVolme((float)value / 100f);
				}
				break;
			}
			case XOptionsDefine.OD_VOICE:
				this.openVoice = (value == 1);
				this.SetVoiceVolme(this.openVoice ? ((this.lastVoice == -1f) ? 1f : this.lastVoice) : 0f);
				break;
			case XOptionsDefine.BA_VOICE:
			{
				bool flag3 = this.openVoice;
				if (flag3)
				{
					this.SetVoiceVolme((float)value / 100f);
				}
				break;
			}
			case (XOptionsDefine)7:
			case (XOptionsDefine)8:
			case (XOptionsDefine)9:
			case (XOptionsDefine)18:
			case (XOptionsDefine)19:
			case XOptionsDefine.OD_TEAM_USE_PASSWORD:
			case XOptionsDefine.OD_3D_TOUCH:
				break;
			case XOptionsDefine.OD_VOLUME:
			{
				bool flag4 = this.View != null;
				if (flag4)
				{
					this.View.SetVolume(value);
				}
				break;
			}
			case XOptionsDefine.OD_RADIO_WIFI:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.ZeroChannel, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_TEAM:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.Team, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_CAMP:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.Camp, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_PRIVATE:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.Friends, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_PUBLIC:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.Guild, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_WORLD:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.World, value == 1);
				break;
			case XOptionsDefine.OD_RADIO_AUTO_PALY:
				XSingleton<XChatIFlyMgr>.singleton.SetChannelAutoPlay(ChatChannelType.Curr, value == 1);
				break;
			case XOptionsDefine.OD_QUALITY:
				this._ProcessQuality(value);
				break;
			case XOptionsDefine.OD_FLOWERRAIN:
				this.Flowerrain = (value == 1);
				break;
			case XOptionsDefine.OD_SAMESCREENNUM:
				XQualitySetting.SetVisibleRoleLevel(value);
				break;
			case XOptionsDefine.OD_RADIO:
				DlgBase<RadioDlg, RadioBehaviour>.singleton.Process(value == 1);
				break;
			case XOptionsDefine.OD_SMOOTH:
				XSingleton<XGameUI>.singleton.SetUIOptOption(false, value == 1, false, true);
				break;
			case XOptionsDefine.OD_RESOLUTION:
				XQualitySetting.SetResolution((XQualitySetting.EResolution)value, false);
				break;
			case XOptionsDefine.OD_POWERSAVE:
				this._ProcessPowerSave(value);
				break;
			case XOptionsDefine.OD_NOTIFICATION:
				this._ProcessNotification(value);
				break;
			case XOptionsDefine.OD_BLOCKOTHERPLAYERS:
				this._ProcessBlockOtherPlayers(value);
				break;
			default:
				switch (option)
				{
				case XOptionsDefine.OD_Gyro:
					XSingleton<XGyroscope>.singleton.Enabled = (value == 1);
					break;
				case XOptionsDefine.OD_Shield_Skill_Fx:
					XSingleton<XInput>.singleton.UpdateShieldOperation();
					break;
				case XOptionsDefine.OD_Shield_Summon:
					XSingleton<XInput>.singleton.UpdateShieldOperation();
					break;
				case XOptionsDefine.OD_Shield_My_Skill_Fx:
					XSingleton<XInput>.singleton.UpdateShieldOperation();
					break;
				}
				break;
			}
		}

		// Token: 0x06009BF7 RID: 39927 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		private void ProccessOption(XOptionsDefine option, float value)
		{
		}

		// Token: 0x06009BF8 RID: 39928 RVA: 0x00190DF4 File Offset: 0x0018EFF4
		private string GetDefaultStrValue(XOptionsDefine option)
		{
			return string.Empty;
		}

		// Token: 0x06009BF9 RID: 39929 RVA: 0x00190E14 File Offset: 0x0018F014
		private float GetDefaultFloatValue(XOptionsDefine option)
		{
			string configurationDefault = this.GetConfigurationDefault(option);
			bool flag = string.IsNullOrEmpty(configurationDefault);
			float result;
			if (flag)
			{
				result = 0f;
			}
			else
			{
				result = float.Parse(configurationDefault);
			}
			return result;
		}

		// Token: 0x06009BFA RID: 39930 RVA: 0x00190E4C File Offset: 0x0018F04C
		private int GetDefaultValue(XOptionsDefine option)
		{
			int result;
			switch (option)
			{
			case XOptionsDefine.OD_QUALITY:
				result = XQualitySetting.GetDefaultQualityLevel();
				break;
			case XOptionsDefine.OD_FLOWERRAIN:
				result = ((XQualitySetting.GetDefaultQualityLevel() == XFastEnumIntEqualityComparer<XQualitySetting.ESetting>.ToInt(XQualitySetting.ESetting.ELow)) ? 0 : 1);
				break;
			case XOptionsDefine.OD_SAMESCREENNUM:
				result = XQualitySetting.GetDefalutVisibleRoleLevel();
				break;
			default:
				if (option != XOptionsDefine.OD_RESOLUTION)
				{
					if (option != XOptionsDefine.OD_TAILCAMERA_SPEED)
					{
						string configurationDefault = this.GetConfigurationDefault(option);
						bool flag = string.IsNullOrEmpty(configurationDefault);
						if (flag)
						{
							result = 0;
						}
						else
						{
							result = int.Parse(configurationDefault);
						}
					}
					else
					{
						bool flag2 = XSingleton<XEntityMgr>.singleton.Player != null;
						if (flag2)
						{
							result = XSingleton<XOperationData>.singleton.TailCameraSpeed;
						}
						else
						{
							result = 50;
						}
					}
				}
				else
				{
					result = XQualitySetting.GetDefalutResolution();
				}
				break;
			}
			return result;
		}

		// Token: 0x06009BFB RID: 39931 RVA: 0x00190EF4 File Offset: 0x0018F0F4
		public bool IsShow3DTouch()
		{
			return Application.platform == (RuntimePlatform)8 && XSingleton<XUpdater.XUpdater>.singleton.XPlatform.CheckStatus("Is_3DTouch_Supported", "");
		}

		// Token: 0x06009BFC RID: 39932 RVA: 0x000FEEFC File Offset: 0x000FD0FC
		private void _ProcessPowerSave(int value)
		{
		}

		// Token: 0x06009BFD RID: 39933 RVA: 0x00190F2A File Offset: 0x0018F12A
		private void _ProcessNotification(int value)
		{
			XSingleton<XUpdater.XUpdater>.singleton.XPlatform.SetPushStatus(true);
		}

		// Token: 0x06009BFE RID: 39934 RVA: 0x00190F3E File Offset: 0x0018F13E
		private void _ProcessQuality(int value)
		{
			XQualitySetting.SetQuality(value, false);
			XQualitySetting.PostSetQuality();
			XQualitySetting.PostSetting();
		}

		// Token: 0x06009BFF RID: 39935 RVA: 0x00190F58 File Offset: 0x0018F158
		private void _ProcessBlockOtherPlayers(int value)
		{
			bool flag = XSingleton<XGame>.singleton.CurrentStage != null && XSingleton<XGame>.singleton.CurrentStage.Stage == EXStage.Hall;
			if (flag)
			{
				XSingleton<XEntityMgr>.singleton.ToggleOtherPlayers(value == 1);
			}
		}

		// Token: 0x06009C00 RID: 39936 RVA: 0x00190F9A File Offset: 0x0018F19A
		protected override void OnReconnected(XReconnectedEventArgs arg)
		{
			this.InitServerConfig(arg.PlayerInfo.config);
		}

		// Token: 0x06009C01 RID: 39937 RVA: 0x00190FB0 File Offset: 0x0018F1B0
		private bool OnChatVoiceHandled(XEventArgs e)
		{
			XAudioOperationArgs xaudioOperationArgs = e as XAudioOperationArgs;
			bool isAudioOn = xaudioOperationArgs.IsAudioOn;
			if (isAudioOn)
			{
				float volume = 1f;
				XApolloDocument specificDocument = XDocuments.GetSpecificDocument<XApolloDocument>(XApolloDocument.uuID);
				bool flag = specificDocument != null;
				if (flag)
				{
					bool isRealtimeVoiceOn = specificDocument.IsRealtimeVoiceOn;
					if (isRealtimeVoiceOn)
					{
						volume = (float)XSingleton<XGlobalConfig>.singleton.GetInt("SetMusicVol") / 100f;
					}
				}
				XSingleton<XAudioMgr>.singleton.SetBusStatuMute("bus:/MainGroupControl", volume);
			}
			else
			{
				XSingleton<XAudioMgr>.singleton.SetBusStatuMute("bus:/MainGroupControl", 0f);
			}
			return true;
		}

		// Token: 0x06009C02 RID: 39938 RVA: 0x00191044 File Offset: 0x0018F244
		public void SetBGMVolme(float vol)
		{
			this.bgmVolme = Mathf.Clamp01(vol);
			XSingleton<XAudioMgr>.singleton.SetBGMVolme(this.bgmVolme);
		}

		// Token: 0x06009C03 RID: 39939 RVA: 0x00191064 File Offset: 0x0018F264
		public void SetMuscVolme(float vol)
		{
			this.mscVolme = Mathf.Clamp01(vol);
			XSingleton<XAudioMgr>.singleton.SetMscVolme(this.mscVolme);
		}

		// Token: 0x06009C04 RID: 39940 RVA: 0x00191084 File Offset: 0x0018F284
		public void SetVoiceVolme(float vol)
		{
			this.voiceVolme = vol;
		}

		// Token: 0x06009C05 RID: 39941 RVA: 0x00191090 File Offset: 0x0018F290
		public string GetConfigurationDefault(XOptionsDefine option)
		{
			XOptionsDocument.OptionData optionData;
			bool flag = XOptionsDocument.optionsDefault.TryGetValue(option, out optionData);
			string result;
			if (flag)
			{
				int num = optionData.NeedSight ? this.GetValue(XOptionsDefine.OD_VIEW) : 1;
				bool flag2 = optionData.NeedProfession[num - 1];
				int num2;
				if (flag2)
				{
					bool flag3 = XSingleton<XAttributeMgr>.singleton.XPlayerData == null;
					if (flag3)
					{
						return null;
					}
					num2 = XFastEnumIntEqualityComparer<RoleType>.ToInt(XSingleton<XAttributeMgr>.singleton.XPlayerData.Profession) % 10;
				}
				else
				{
					num2 = 1;
				}
				result = optionData.val[num - 1, num2 - 1];
			}
			else
			{
				result = null;
			}
			return result;
		}

		// Token: 0x06009C06 RID: 39942 RVA: 0x0019112C File Offset: 0x0018F32C
		public bool SetBattleOptionValue()
		{
			XSingleton<XDebug>.singleton.AddGreenLog("__RefreshBattleOptionValue", null, null, null, null, null);
			XOperationMode value = (XOperationMode)this.GetValue(XOptionsDefine.OD_VIEW);
			XSingleton<XOperationData>.singleton.OperationMode = value;
			XSingleton<XInput>.singleton.UpdateDefaultCameraOperationByScene();
			bool flag = value == XOperationMode.X25D;
			if (flag)
			{
				XSingleton<XOperationData>.singleton.TailCameraSpeed = (int)this.GetFloatValue(XOptionsDefine.OD_TailCameraSpeed25D);
				XSingleton<XOperationData>.singleton.ManualCameraSpeedXInBattle = this.GetFloatValue(XOptionsDefine.OD_ManualCameraSpeedXInBattle25D);
			}
			else
			{
				bool flag2 = value == XOperationMode.X3D;
				if (flag2)
				{
					XSingleton<XOperationData>.singleton.TailCameraSpeed = (int)this.GetFloatValue(XOptionsDefine.OD_TailCameraSpeed3D);
					XSingleton<XOperationData>.singleton.ManualCameraSpeedXInBattle = this.GetFloatValue(XOptionsDefine.OD_ManualCameraSpeedXInBattle3D);
					bool flag3 = XSingleton<XGame>.singleton.CurrentStage.Stage != EXStage.Hall;
					if (flag3)
					{
						XSingleton<XOperationData>.singleton.AllowVertical = (this.GetValue(XOptionsDefine.OD_Vertical3D) == 1);
					}
				}
				else
				{
					bool flag4 = value == XOperationMode.X3D_Free;
					if (flag4)
					{
						XSingleton<XOperationData>.singleton.TailCameraSpeed = (int)this.GetFloatValue(XOptionsDefine.OD_TailCameraSpeed3DFree);
						XSingleton<XOperationData>.singleton.ManualCameraSpeedXInBattle = this.GetFloatValue(XOptionsDefine.OD_ManualCameraSpeedXInBattle3DFree);
						bool flag5 = XSingleton<XGame>.singleton.CurrentStage.Stage != EXStage.Hall;
						if (flag5)
						{
							XSingleton<XOperationData>.singleton.AllowVertical = (this.GetValue(XOptionsDefine.OD_Vertical3DFree) == 1);
						}
						XSingleton<XOperationData>.singleton.CameraDistance = this.GetFloatValue(XOptionsDefine.OD_Distance3DFree);
					}
				}
			}
			XOperateMode value2 = (XOperateMode)this.GetValue(XOptionsDefine.OD_OPERATE);
			int num = this.GetValue(XOptionsDefine.OD_OPERATE) - 1;
			XSingleton<XOperationData>.singleton.ManualCameraSpeedXInHall = this.GetFloatValue(XOptionsDefine.ManualCameraSpeedXInHallAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraDampXInHall = this.GetFloatValue(XOptionsDefine.ManualCameraDampXInHallAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraSpeedYInHall = this.GetFloatValue(XOptionsDefine.ManualCameraSpeedYInHallAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraDampYInHall = this.GetFloatValue(XOptionsDefine.ManualCameraDampYInHallAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraDampXInBattle = this.GetFloatValue(XOptionsDefine.ManualCameraDampXInBattleAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraSpeedYInBattle = this.GetFloatValue(XOptionsDefine.ManualCameraSpeedYInBattleAutoLock + num);
			XSingleton<XOperationData>.singleton.ManualCameraDampYInBattle = this.GetFloatValue(XOptionsDefine.ManualCameraDampYInBattleAutoLock + num);
			XSingleton<XOperationData>.singleton.RangeWeight = (int)this.GetFloatValue(XOptionsDefine.RangeWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.BossWeight = (int)this.GetFloatValue(XOptionsDefine.BossWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.EliteWeight = (int)this.GetFloatValue(XOptionsDefine.EliteWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.EnemyWeight = (int)this.GetFloatValue(XOptionsDefine.EnemyWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.PupetWeight = (int)this.GetFloatValue(XOptionsDefine.PupetWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.RoleWeight = (int)this.GetFloatValue(XOptionsDefine.RoleWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.ImmortalWeight = (int)this.GetFloatValue(XOptionsDefine.ImmortalWeightAutoLock + num);
			XSingleton<XOperationData>.singleton.WithinScope = this.GetFloatValue(XOptionsDefine.WithinScopeAutoLock + num);
			XSingleton<XOperationData>.singleton.WithinRange = this.GetFloatValue(XOptionsDefine.WithinRangeAutoLock + num);
			XSingleton<XOperationData>.singleton.AssistAngle = this.GetFloatValue(XOptionsDefine.AssistAngleAutoLock + num);
			XSingleton<XOperationData>.singleton.ProfRange = this.GetFloatValue(XOptionsDefine.ProfRangeAutoLock + num);
			XSingleton<XOperationData>.singleton.ProfRangeLong = this.GetFloatValue(XOptionsDefine.ProfRangeLongAutoLock + num);
			XSingleton<XOperationData>.singleton.ProfRangeAll = this.GetFloatValue(XOptionsDefine.ProfRangeAllAutoLock + num);
			XSingleton<XOperationData>.singleton.ProfScope = (int)this.GetFloatValue(XOptionsDefine.ProfScopeAutoLock + num);
			XSingleton<XOperationData>.singleton.CameraAdjustScope = (int)this.GetFloatValue(XOptionsDefine.CameraAdjustScopeAutoLock + num);
			XSingleton<XInput>.singleton.UpdateOperationMode();
			XBattleSkillDocument specificDocument = XDocuments.GetSpecificDocument<XBattleSkillDocument>(XBattleSkillDocument.uuID);
			bool flag6 = specificDocument.BattleView != null && specificDocument.BattleView.IsVisible();
			if (flag6)
			{
				specificDocument.BattleView.OnSetOptionsValue();
			}
			return true;
		}

		// Token: 0x040035FE RID: 13822
		public new static readonly uint uuID = XSingleton<XCommon>.singleton.XHash("OptionsDocument");

		// Token: 0x040035FF RID: 13823
		private XOptionsView _view = null;

		// Token: 0x04003600 RID: 13824
		public static readonly int SIGHT_NUM = 3;

		// Token: 0x04003601 RID: 13825
		public static readonly int MAGNIFICATION_MULTIPLE = 1000;

		// Token: 0x04003602 RID: 13826
		private readonly int[] _QualityLevel = new int[]
		{
			0,
			3,
			5
		};

		// Token: 0x04003603 RID: 13827
		private Dictionary<XOptionsDefine, int> options = new Dictionary<XOptionsDefine, int>(default(XFastEnumIntEqualityComparer<XOptionsDefine>));

		// Token: 0x04003604 RID: 13828
		private Dictionary<XOptionsDefine, float> floatOptions = new Dictionary<XOptionsDefine, float>(default(XFastEnumIntEqualityComparer<XOptionsDefine>));

		// Token: 0x04003605 RID: 13829
		private Dictionary<XOptionsDefine, string> strOptions = new Dictionary<XOptionsDefine, string>(default(XFastEnumIntEqualityComparer<XOptionsDefine>));

		// Token: 0x04003606 RID: 13830
		public static Dictionary<string, int> pushSettings = new Dictionary<string, int>();

		// Token: 0x04003607 RID: 13831
		public static Dictionary<string, int> localPushSetting = new Dictionary<string, int>();

		// Token: 0x04003608 RID: 13832
		public static PushSetting _pushSettingTable = new PushSetting();

		// Token: 0x04003609 RID: 13833
		public static PushMessageTable _pushMessageTable = new PushMessageTable();

		// Token: 0x0400360A RID: 13834
		public static List<PushSetting.RowData> _pushSetting1 = new List<PushSetting.RowData>();

		// Token: 0x0400360B RID: 13835
		public static List<PushSetting.RowData> _pushSetting2 = new List<PushSetting.RowData>();

		// Token: 0x0400360C RID: 13836
		public static XOptions _optionsTable = new XOptions();

		// Token: 0x0400360D RID: 13837
		public static List<List<List<XOptions.RowData>>> optionsData = new List<List<List<XOptions.RowData>>>();

		// Token: 0x0400360E RID: 13838
		public static Dictionary<XOptionsDefine, XOptionsDocument.OptionData> optionsDefault = new Dictionary<XOptionsDefine, XOptionsDocument.OptionData>(default(XFastEnumIntEqualityComparer<XOptionsDefine>));

		// Token: 0x0400360F RID: 13839
		public static XTableAsyncLoader AsyncLoader = new XTableAsyncLoader();

		// Token: 0x04003610 RID: 13840
		public bool openVoice = true;

		// Token: 0x04003611 RID: 13841
		public float voiceVolme = 1f;

		// Token: 0x04003612 RID: 13842
		private float bgmVolme;

		// Token: 0x04003613 RID: 13843
		private float mscVolme;

		// Token: 0x04003614 RID: 13844
		public bool Flowerrain;

		// Token: 0x04003615 RID: 13845
		private static XOptionsDocument.OptionData optionDefault = default(XOptionsDocument.OptionData);

		// Token: 0x04003616 RID: 13846
		private float lastSameScreenValue;

		// Token: 0x04003617 RID: 13847
		private float lastSound = -1f;

		// Token: 0x04003618 RID: 13848
		private float lastMusic = -1f;

		// Token: 0x04003619 RID: 13849
		private float lastVoice = -1f;

		// Token: 0x0400361A RID: 13850
		private bool openSound;

		// Token: 0x0400361B RID: 13851
		private bool openMusic;

		// Token: 0x02001986 RID: 6534
		public struct OptionData
		{
			// Token: 0x06011010 RID: 69648 RVA: 0x004533C0 File Offset: 0x004515C0
			public void Init()
			{
				this.val = new string[XOptionsDocument.SIGHT_NUM, XGame.RoleCount];
				this.NeedProfession = new bool[XOptionsDocument.SIGHT_NUM];
			}

			// Token: 0x04007ED3 RID: 32467
			public string[,] val;

			// Token: 0x04007ED4 RID: 32468
			public bool NeedSight;

			// Token: 0x04007ED5 RID: 32469
			public bool[] NeedProfession;
		}
	}
}
